﻿using System;
using System.Collections.Generic;
using System.IO;

class Solution
{
    static void Main(String[] args)
    {
        Solve();
        Console.ReadKey();
    }

    private static void Solve(int t = 1)
    {
        int n = NextInt;
        int m = NextInt;

        Node[] nodes = new Node[n + 1];
        List<int>[] adj = new List<int>[n + 1];
        for (int i = 1; i <= n; ++i)
        {
            adj[i] = new List<int>();
        }
        for (int i = 0; i < m; ++i)
        {
            int u = NextInt;
            int v = NextInt;
            adj[u].Add(v);
            adj[v].Add(u);
        }

        int ans = 0;
        Visit(1, 0, adj, nodes, ref ans);
        Console.WriteLine(ans - 1);
    }

    private static void Visit(int u, int parent, List<int>[] adj, Node[] nodes, ref int ans)
    {
        nodes[u] = new Node(u, parent, 1);
        foreach (int v in adj[u])
        {
            if (nodes[v] == null)
            {
                Visit(v, u, adj, nodes, ref ans);
                nodes[u].Nodes.Add(nodes[v]);
                nodes[u].ChildCount += nodes[v].ChildCount;
            }
        }
        if (nodes[u].ChildCount % 2 == 0)
        {
            ans += 1;
        }
    }

    private static int NextInt
    {
        get { return int.Parse(NextToken); }
    }

    private static string NextToken
    {
        get
        {
            int a;
            while ((a = Console.Read()) < '0') ;
            string result = ((char)a).ToString();
            while ((a = Console.Read()) >= '0') result += (char)a;
            return result;
        }
    }

    class Node
    {
        public int Index { get; set; }
        public int Parent { get; set; }
        public int ChildCount { get; set; }
        public List<Node> Nodes { get; set; }
        public Node(int index, int parent, int childCount = 0)
        {
            this.Index = index;
            this.Parent = parent;
            this.ChildCount = childCount;
            this.Nodes = new List<Node>();
        }
    }
}